#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>

#include <unistd.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <arpa/inet.h>

#define sleep(a)

int main(int argc, char* argv[]) {
	int sockfd;
	struct linger ling;
	struct sockaddr_in servaddr;

	sockfd = socket(AF_INET, SOCK_STREAM, 0);
	servaddr.sin_family = AF_INET;
	servaddr.sin_addr.s_addr = inet_addr("127.0.0.1");
	servaddr.sin_port = htons(4567);

	connect(sockfd, (struct sockaddr*)&servaddr, sizeof(servaddr));

	send(sockfd, "123", 3, 0);
	sleep(1);
	send(sockfd, "4", 1, MSG_OOB);
	sleep(1);
	send(sockfd, "567", 3, 0);
	sleep(1);
	send(sockfd, "8", 1, MSG_OOB);
	sleep(1);
	send(sockfd, "90", 2, 0);
	sleep(1);

	ling.l_onoff  = 1;
	ling.l_linger = 0;
	setsockopt(sockfd, SOL_SOCKET, SO_LINGER, &ling, sizeof(ling));
	close(sockfd);

	return 0;
}